package com.glodon.paas.security.oauth1;

import oauth.signpost.basic.DefaultOAuthConsumer;
import oauth.signpost.exception.OAuthCommunicationException;
import oauth.signpost.exception.OAuthExpectationFailedException;
import oauth.signpost.exception.OAuthMessageSignerException;
import oauth.signpost.http.HttpRequest;

public class OAuthConsumerEx extends DefaultOAuthConsumer {

    public OAuthConsumerEx(String consumerKey, String consumerSecret) {
        super(consumerKey, consumerSecret);
    }

    public String sign(String url, String method) throws OAuthMessageSignerException,
            OAuthExpectationFailedException, OAuthCommunicationException {
        HttpRequest request = new UrlStringRequestAdapterEx(url, method);
        sign(request);
        return request.getRequestUrl();
    }

}
